/**
 * Class containing the tit-for-two-tats strategy.
 * @author	081028AW
 */
public class StrategySimple extends Strategy
   {
  /**
   * Encoding for tit-for-tat strategy.
   */

   //int moveNum;
   public String simpleStratMoves;
   //int simpleStratMoves[];
   int currMove;
   public String simpleStrat;
   //public int simpleStrat[]; 

  // 0 = defect, 1 = cooperate

   public StrategySimple()
	{
		name = "Simple";
		currMove = 0;
		//moveNum = 25;
		/*for(int i = 0; i < moveNum; i++)
		{
			//simpleStratMoves[i] = simpleStrat[i];
			simpleStratMoves[i] = 0;
		}*/
	}  /* StrategySimple */

   /*public void getCurrStrat(int[] currStrat)
   {
	simpleStratMoves = currStrat;
   }*/

   public void getCurrStrat(String currStrat)
   {
	simpleStratMoves = currStrat;
   }

   public void getCurrLength(int currLength)
   {
	moveNum = currLength;
   }

   public int nextMove()
      {
	if(currMove >= moveNum-1)
	{
		currMove = 0;
	}
	else
	{
		
		currMove++;
	}

	//System.out.println("output: " + simpleStratMoves.charAt(currMove) + ", moveNum: " + moveNum);
	
	return Character.digit(simpleStratMoves.charAt(currMove), 10);

      }  /* nextMove */

   }  /* class StrategyTitForTwoTats */

